package com.cn.hotel.service.impl;

import com.cn.hotel.dao.IOrderDao;
import com.cn.hotel.dao.Impl.OrderImpl;
import com.cn.hotel.model.OrderModel;
import com.cn.hotel.service.IOrderService;

import java.util.List;

public class OrderServiceImpl implements  IOrderService {
    /**
     * 查询所有订单信息
     * @return
     */
//    @Override
//    public List<OrderModel> findAllOrder() {
//        IOrderDao iOrderDao = new OrderImpl();
//        List<OrderModel> list = iOrderDao.findAllOrder();
//        return list;
//    }

    /**
     * 添加订单信息
     * @return
     */
    @Override
    public int add(OrderModel orderModel) {
        IOrderDao iOrderDao = new OrderImpl();
        int count = iOrderDao.add(orderModel);
        return count;
    }

    /**
     * 对订单信息得模糊查询
     * @param orderModel
     * @return
     */
    @Override
    public List<OrderModel> findByKeyWord(OrderModel orderModel) {
        IOrderDao iOrderDao = new OrderImpl();
        List<OrderModel> list = iOrderDao.findByKeyWord(orderModel);
        return list;
    }

    @Override
    public int getCount(OrderModel orderModel) {
        IOrderDao iOrderDao = new OrderImpl();
        return iOrderDao.getCount(orderModel);
    }

    /**
     * 通过id查找点击id的信息然后给页面赋值
     * @param temp
     * @return
     */
    @Override
    public OrderModel findfById(Integer temp) {
        IOrderDao iOrderDao = new OrderImpl();
        return iOrderDao.findById(temp);
    }

    /**
     * 保存修改
     * @param orderModel
     * @return
     */
    @Override
    public int orderEdit(OrderModel orderModel) {
        IOrderDao iOrderDao = new OrderImpl();
        return iOrderDao.orderEdit(orderModel);
    }

    /**
     * 删除
     * @param temp
     * @return
     */
    @Override
    public int delete(Integer temp) {
        IOrderDao iOrderDao = new OrderImpl();
        return iOrderDao.delete(temp);
    }
}
